package com.xywy.tangandroid.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.RelativeLayout;

import com.xywy.tangandroid.R;
import com.xywy.tangandroid.activity.BloodDataTest;
import com.xywy.tangandroid.vollery.VolleyManager;

public class MyWearFragement extends Fragment implements OnClickListener {

	private RelativeLayout blood_measure_butto;

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		View view = inflater.inflate(R.layout.fragement_my_wear, null);
		initview(view);
		initonclicklister();
		return view;
	}

	private void initview(View view) {
		blood_measure_butto = (RelativeLayout) view.findViewById(R.id.blood_measure_button);
	}

	private void initonclicklister() {
		blood_measure_butto.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.blood_measure_button:
			Intent intent = new Intent(getActivity(), BloodDataTest.class);
			startActivity(intent);
			break;

		default:
			break;
		}
	}

	@Override
	public void onDestroy() {
		super.onDestroy();
		VolleyManager.cancelRequest(getActivity());
	}
}
